//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;

namespace OpenLS.Spreadsheet.Expressions
{
    internal class TableAccessExpression : Expression
    {
        private readonly string _tableName; //\\ Use table object instead
        private readonly MultiRowOrColumnAccessor _row;
        private readonly MultiRowOrColumnAccessor _column;
        public override IEnumerable<Expression> GetSubExpressions()
        {
            yield break;
        }

        public TableAccessExpression(string tableName, MultiRowOrColumnAccessor row, MultiRowOrColumnAccessor column)
        {
            _tableName = tableName;
            _row = row;
            _column = column;
        }
        internal override Expression Transposed(Cell target)
        {
            return this;
        }

        public override string GetText(TextContext context)
        {
            return _tableName + "[" + _row+ "," + _column + "]";
        }

        public override IEnumerable<IDependencyNode> GetPrecedents(EvaluationContext context)
        {
            yield break; //\\ sure?
        }

        protected override object GetObjectImp(EvaluationContext context)
        {
            throw new NotImplementedException();
        }

        public override Expression Offset(CellRelativeAddress a)
        {
            throw new NotImplementedException();
        }
    }
}